package com.shiro.services;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.session.Session;

import java.util.Date;

public class ShiroServices {

    @RequiresRoles("admin")
    public void testMethod() {
        Session session = SecurityUtils.getSubject().getSession();
        Object val = session.getAttribute("key");
        System.out.println("========================================ServiceSessionValue: " + val + "=========================================");
        System.out.println("========================================testMethod: " + new Date() + "=========================================");
    }
}
